/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.core.base.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * 领域事件发布实现类
 *
 * @author 挺好的 2023年06月08日 9:19
 */
@Component
@Slf4j
public class DomainEventPublisherImpl implements DomainEventPublisher {

    /**
     * application 事件发布
     */
    @Autowired
    private ApplicationEventPublisher applicationEventPublisher;

    /**
     * 事件发布
     *
     * @param event
     *         领域事件
     */
    @Override
    public void publishEvent (BaseDomainEvent event) {
        this.applicationEventPublisher.publishEvent(event);
    }
}
